﻿namespace GoodAdmin.System;

/// <summary>
/// 系统组织表
/// </summary>
[SugarTable(tableName: "Sys_Org", "系统组织表")]
public class SysOrg: BaseEntityHasPid
{
    /// <summary>
    /// 组织名称
    /// </summary>
    [SugarColumn(ColumnDescription = "组织名称", Length =100)]
    public virtual string OrgName { get; set; }

    /// <summary>
    /// 组织长名称
    /// </summary>
    [SugarColumn(ColumnDescription = "组织长名称", Length = 300)]
    public virtual string LongName { get; set; }

    /// <summary>
    /// 组织编码
    /// </summary>
    [SugarColumn(ColumnDescription = "组织编码", Length = 50)]
    public string Code { get; set; }

    /// <summary>
    /// 主管ID
    /// </summary>
    [SugarColumn(ColumnDescription = "主管ID", IsNullable = true)]
    public long? DirectorId { get; set; }   

    /// <summary>
    /// 备注
    /// </summary>
    [SugarColumn(ColumnDescription = "备注", Length = 100, IsNullable = true)]
    public string Remark { get; set; }
    /// <summary>
    /// 分类(公司、部门)
    /// </summary>
    [SugarColumn(ColumnDescription = "分类", Length = 100)]
    public string Category { get; set; }

    /// <summary>
    /// 排序码
    /// </summary>
    [SugarColumn(ColumnDescription = "排序码", IsNullable = true)]
    public int? SortCode { get; set; }
    /// <summary>
    /// 机构子项
    /// </summary>
    [SugarColumn(IsIgnore = true)]
    public List<SysOrg> Children { get; set; }
}